package com.yejiali.backend.exception;


import com.yejiali.backend.common.apicode.ResponseCodeEnum;

/**
 * @Author:yejiali
 * @Date:2025/6/16-06-16-16:34
 * @Decsription:自定义异常类
 * @Version:1.0
 */

public class BusinessException extends RuntimeException{
    private int code;
    private String msg;
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    public BusinessException(ResponseCodeEnum responseCodeEnum) {
        super(responseCodeEnum.getMessage());
        this.code = responseCodeEnum.getCode();
        this.msg = responseCodeEnum.getMessage();
    }
    public BusinessException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

}
